<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<title>Catalog</title>
</head>
<body>
<body background="../../img/bg.jpg"> 
	<font face="Berlin Sans FB Demi" color="#357EC7" size="3">
<center>
	<?
include('../auth.php');
include('../../config.php');
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {die('Failed to connect to server: ' . mysql_error());}
     error_reporting (E_ALL ^ E_NOTICE);      
$db = mysql_select_db(DB_DATABASE);
if(!$db) {die("Unable to select database");}

?>
<br><br>
<h1>Modificare clasa</h2>
<form action="claseedit.php" method="post">
<table border="1">
<? 
$nume2=$_GET['nume'];
echo '<tr><td>Nume: <input type="text" value="'.$nume2.'" name="nume"></tr></td>';
echo '<tr><td><center><input type="submit" value="Modifica"></center></tr></td>';
echo '</table></form>';
function clean($str) {
		$str = @trim($str);
		if(get_magic_quotes_gpc()) {
			$str = stripslashes($str);
		}
		return mysql_real_escape_string($str);
	}
$nume=clean($_POST['nume']);


if ($nume!='') {
$query=mysql_query("update clase set nume='".$nume."' where nume='".$nume2."'");
echo '<script type="text/javascript">
window.location = "clase.php"
</script>';
}
?>
</font>
</body>
</html>